import tweepy
import time
#insert your Twitter keys here
consumer_key = "KU8y0jCijZYTZKD1JNXxyuCe4"
consumer_secret = "IRdkpvddpsXS9QF5AMnrdMx9CN0Mqc0O52zFu1iXTE723F1fgt"
access_key = "1346256042-7aJMv5FlYas6ue27nKxFEi8PRNExDGSAFODJd20"
access_secret = "gEplKhvd07i5eEJX51osZhLyX4KnDiFqyCUc3UQAnR0lI"
 

auth = tweepy.auth.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
 
list = open('fol.txt','w')
 
if(api.verify_credentials):
    print ('We sucessfully logged in')
 
user = tweepy.Cursor(api.followers, screen_name="arabbankgroup").items()
 
while True:
    try:
        u = next(user)
        list.write(u.screen_name +' n')
 
    except:
        print ('We got a timeout ... Sleeping for 15 minutes')
        time.sleep(15*60)
        u = next(user)
        list.write(u.screen_name +' n')
list.close()
